Skip to content

Conversation

@surinder-tsys
Copy link
Collaborator

@surinder-tsys surinder-tsys commented Jun 2, 2025

This PR contains the new Albums Functionality.

Library PR: nextcloud/android-library#1736

  • Tests written, or not not needed

@surinder-tsys
Copy link
Collaborator Author

Hi, @alperozturk96 there is one issue which I couldn't able to fix it. When we open Album images in preview then they don't open in proper order. Because while swiping the images which are not in current Album also shows up.
There must be something in PreviewImageActivity due to which it loads all Images.
Can you help me out how we can fix it? Do I have to create a separate Preview activity for Albums or I can utilize the existing one?

@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Signed-off-by: A117870935 <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: A117870935 <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: Surinder Kumar <surinder.kumar@t-systems.com>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@github-actions
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14947.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@github-actions
Copy link

Codacy

SpotBugs

CategoryBaseNew
Bad practice4343
Correctness7474
Dodgy code256259
Experimental11
Internationalization77
Malicious code vulnerability33
Multithreaded correctness3434
Performance4343
Security1818
Total479482

SpotBugs increased!

@github-actions
Copy link

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

Copy link
Collaborator

@alperozturk96 alperozturk96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello

Thank you for the PR.

notificationManager.dismissNotification()
}

private fun setWorkerState(user: User?) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove these worker states otherwise consumers such as FileDisplayActivity will be refreshed and instead of worker state this approach will be used details are written in the issue.

break
}

sendUploadFinishEvent(totalUploadSize, currentUploadIndex, operation, result)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check this PR and see if it’s necessary to update the UI call events in the same way it was handled there?

/** 1. check copy validity */
val result: RemoteOperationResult<Any>

if (targetParentPath.startsWith(srcPath)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

srcPath = "/Photos/Vacation"
targetParentPath = "/Photos/Vacation2025"

In this case first if check will be true and we will block valid copy operation.

captionText = resources.getText(R.string.media_picker_toolbar_title).toString()
}

folderPickerBinding.folderPickerBtnCopy.visibility = View.GONE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use this pattern to remove same prefix for all items.

folderPickerBinding.run {
      folderPickerBtnMove.visibility = View.GONE
      ...
      ...
}

}
}

private fun createGalleryFragment() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private fun createGalleryFragment() {
        val bundle = Bundle().apply {
            putParcelable(
                OCFileListFragment.SEARCH_EVENT,
                SearchEvent("image/%", SearchRemoteOperation.SearchType.PHOTO_SEARCH)
            )
            putBoolean(EXTRA_FROM_ALBUM, true)
        }

        val fragment = GalleryFragment().apply {
            arguments = bundle
        }

        supportFragmentManager.beginTransaction().run {
            add(R.id.fragment_container, fragment, TAG_LIST_OF_FOLDERS)
            commit()
        }
    }

}
}

override fun showDetails(file: OCFile?) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Unit and remove comments.

e.g.

override fun showDetails(file: OCFile?) = Unit

}
}

override fun onRefresh(enforced: Boolean) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Unit

// nothing to do here
}

override fun onOverflowIconClicked(file: OCFile?, view: View?) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Unit here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants